<?php
/**
 * @file test014.php
 * @package taobaoke
 * @subpackage 
 * @version $id: 0.1 UTF-8 2009-7-22 下午07:23:21 $
 * @author LD King (mifunny.info)
 * @copyright Copyright (c) 2007 - 2009 MiFunny China Inc. (http://mifunny.info)
 * 测试AJAX
 */
$session = trim($_GET['top_session']);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex,nofollow" />
<title>测试AJAX</title> 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<style type="text/css">
	body{
	   margin:0;
	   padding:0;
	   font-size:14px;
	}
	#message {
		height: 250px;
		border: 1px solid;
		padding: 5px;
		overflow: auto;
	}
	#messageWindow {
		margin: auto;
		width: 438px;
	}
</style>
</head>
<body>

	<div id="messageWindow">
		<p id="message"><span id="loading">加载中...</span></p>
	</div>

<form id="form1" action="#">
	<p><input type="submit" id="send" value="提交"/></p>
</form>

<script type="text/javascript">
$(document).ready(function(){
//	alert("I'm Here!");
});


$(document).ready(function(){
	var param = Array(1,2,3,4);
	$('#form1').submit(function(){
		$.post("bg1.php", {
			action: "getTaobaoke",
			session: "<?php echo $session ?>",
			params: param
				}, function(data, textStatus){
					alert(textStatus);
					$("#message").prepend(data); 
				});
		return false;
	});
});

alert(isInteger(''));

function isInteger(str) { 
   // 如果为空，则通过校验 
   // if(str == "") return true; 
   if(/^(\-?)(\d+)$/.test(str)) return true; 
   else return false; 
} 




//$.pot("bg1.php",{
//session: ses,
//cid: $("#cid").val(),
//keyword: $("#keyword").val(),
//sort: $("#sort").val(),
//page_size: $("#page_size").val(),
//action: 'getTaobaoke'
//}, function (data, textStatus){
//	var msg = textStatus;
//	$("#messageWindow").prepend( "AAA"+msg );
//}, "xml" );


	  // 共用这2个全局的ajax事件
//	 $("#loading").ajaxStart(function(){
//		   $(this).show();
//		 }); 
//	 $("#loading").ajaxStop(function(){
//		   $(this).hide();
//		 }); 
</script>




</body>
</html>